package com.jf.yytgd.converter;

import com.jf.yytgd.entity.bean.ScienceArticle;
import com.jf.yytgd.entity.dto.scienceArticle.ScienceArticleBarDTO;
import com.jf.yytgd.entity.dto.scienceArticle.ScienceArticleFullDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * Created with IntelliJ IDEA
 * Description: 科普文章转换器
 * User:22954
 * Date:2025-02-06
 * Time:17:11
 */
@Mapper
public interface ScienceArticleConverter {
    ScienceArticleConverter INSTANCE = Mappers.getMapper(ScienceArticleConverter.class);

    @Mapping(source = "scienceArticleBlob.text", target = "text")
    ScienceArticleFullDTO toFullDto(ScienceArticle scienceArticle);

    ScienceArticleBarDTO toBarDto(ScienceArticle scienceArticle);
}
